package com.lijin.batchsys.framework.enums;

public enum RunningMode {

	START_BATCH("0", "执行整个批次", "执行批次"),
	START_SINGLE_JOB("1", "执行单个任务", "执行任务"),
	START_SINGLE_STEP("2", "执行单个步骤", "执行步骤");
	
	private String code;
	private String desc;
	private String dbDesc;
	

	private RunningMode(String code, String desc, String dbDesc) {
		this.code = code;
		this.desc = desc;
		this.dbDesc = dbDesc;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public String getDbDesc() {
		return dbDesc;
	}
	public void setDbDesc(String dbDesc) {
		this.dbDesc = dbDesc;
	}
	
	public static RunningMode parseByCode(String code) {
		for (RunningMode mode : RunningMode.values()) {
			if (mode.getCode().equals(code)) {
				return mode;
			}
		}
		return null;
	}
}
